import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Observable;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class FenetreVignette extends WindowFactory {

	private static FenetreVignette inst= null;
	private BufferedImage image;
	private Panel panel = new Panel();
	
	public static FenetreVignette getInstance(){
		if(inst == null){
			inst = new FenetreVignette();
		}
		return inst;		
	}
	
	public FenetreVignette() {
	
		
		this.setUndecorated(true);
		this.setLocation(1167, 45);
		this.setSize(200, 150);
		this.setAlwaysOnTop(true);
		this.setResizable(false);	
		
	}
	
	public void addPic(File img) {
		
		
		
		try {
			this.image = ImageIO.read(img);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
		panel.repaint();		
		
		this.add(panel);
			
	}
	
	public class Panel extends JPanel {
		
		
		public void paint(Graphics g) {
			g.drawImage(image, 0, 0, 200, 150, this);

		}
		
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub
		
	}
	
	
	
}
